package com.shangyueshang.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.shangyueshang.model.SysUser;
import com.shangyueshang.model.SysUserRole;
import com.shangyueshang.request.PageReq;
import com.shangyueshang.request.PasswordDTO;
import com.shangyueshang.request.SysUserDTO;
import com.shangyueshang.response.HttpResult;
import com.shangyueshang.response.PageResult;

import java.util.List;
import java.util.Set;

/**
 * @author JokeyFeng
 * @date: 2022/1/4
 * @project: shangyueshang
 * @package: com.shangyueshang.service
 * @comment:
 */
public interface SysUserService extends IService<SysUser> {

    /**
     * 保存用户
     *
     * @param sysUser
     * @return
     */
    HttpResult<Void> save(SysUserDTO sysUser);

    /**
     * 根据名字查询
     *
     * @param name
     * @return
     */
    SysUser findByName(String name);

    /**
     * 分页查询
     *
     * @param pageReq
     * @return
     */
    PageResult<SysUser> findPage(PageReq pageReq);

    /**
     * 查询用户角色
     *
     * @param userId
     * @return
     */
    List<SysUserRole> findUserRoles(Long userId);

    /**
     * 删除用户
     *
     * @param ids
     */
    void delete(List<Long> ids);

    /**
     * 查找用户的菜单权限标识集合
     *
     * @param userName
     * @return
     */
    Set<String> findPermissions(String userName);

    /**
     * 修改密码
     *
     * @param passwordDTO
     * @return
     */
    HttpResult<Void> resetPassword(PasswordDTO passwordDTO);
}
